package com.zcdom.admin.controller;

import com.zcdom.system.entity.User;
import com.zcdom.system.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

@Controller

public class UserController {

    @Autowired
    private IUserService userService;

//    @ResponseBody
//    @RequestMapping(value="/login",method= RequestMethod.GET)
    public List<User> getUserList(){

        List<User> userList=userService.list();

        return userList;

    }
//    @ResponseBody
//    @RequestMapping(value="/login",method= RequestMethod.GET)
    public User getUserById(){

        User user=userService.selectUserById(1L);
        return user;

    }
}
